package SocialMediaSentiment;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;

import jxl.write.WriteException;

public class testSmallSet {
	
	public static void main(String[] args) throws WriteException, IOException
	{
		HashMap<String, String> toexcelwriter = new HashMap<String, String>();
		File input = new File("CorrectedTweetsValidation.txt");
		String lexicon = StandardFunctions.deserializeString(input);
		StringTokenizer stTweets = new StringTokenizer(lexicon, "\n");
		String data, tweet;
		int i = 0;
		String sentiment;
		while(stTweets.hasMoreTokens()){
			i++;
			data = stTweets.nextToken();
			tweet = data.substring(0, data.length()-3).toLowerCase().replace(":", "");
			sentiment = data.substring(data.length()-3, data.length()-1);
			toexcelwriter.put(tweet, sentiment);
		}
		writeExcel.write("CorrectedTweetsValidation.xls", toexcelwriter);
	}

}
